% This function computes marginal utility from consumption 
function deriv_cons = D_u_c(c, rho, crra)

if crra==1
    if rho ~= 1
        deriv_cons = c.^(-rho);
    elseif rho==1
        deriv_cons = 1./c;
    end
elseif crra==0
    deriv_cons = rho*exp(-rho*c);
end